import React from 'react'
import { Switch,BrowserRouter as Router } from 'react-router-dom'
import 'antd/dist/antd.css'
//import { renderRoutes } from 'react-router-config'
import renderRoutes from './utils/renderRoutes'
import routes from './router'
const authed = localStorage.getItem('token') // 如果登陆之后可以利用redux修改该值(关于redux不在我们这篇文章的讨论范围之内）
const authPath = '/login' // 默认未登录的时候返回的页面，可以自行设置
const App = () => (
    <Router>
        <Switch>
            {renderRoutes(routes, authed, authPath)}
        </Switch>
    </Router>
)
export default App
